<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<div id="app">
			<div class="gender">
				<!-- v-model绑定同一个值时, 不需要使用name进行互斥 -->
				<label for="male"> <input type="radio" id="male" v-model="gender" value="male" />男 </label>
				<label for="female"> <input type="radio" v-model="gender" id="female" value="female" />女 </label>
				<h2>{{gender}}</h2>
			</div>

			<div class="select">
				<select name="" id="" v-model="fruit" multiple size="2">
					<option value="apple">苹果</option>
					<option value="orange">橘子</option>
					<option value="banana">香蕉</option>
				</select>

				<h2>{{fruit}}</h2>
			</div>
		</div>

		<script src="./js/vue.js"></script>
		<script>
			// 1. 创建app实例
			const app = Vue.createApp({
				data() {
					return {
						title: '你好',
						gender: 'male',
						fruit: ['apple'],
					}
				},
			})

			// 2. 挂载到#app上
			app.mount('#app')
		</script>
	</body>
</html>
